package com.qkjia.springselltest;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.util.StringUtils;

/*
    禁用特定命令
    要禁用单个内置命令，只需将属性设置为应用中的属性即可。一个简单的方法是将额外的参数传递到您的切入点中的"启动"应用程序：
    spring.shell.command.<command>.enabledfalseEnvironmentmain()
*/
@SpringBootApplication
public class SpringselltestApplication {

    public static void main(String[] args) {
        String[] disabledCommands = {"--spring.shell.command.help.enabled=false"};
        //   1 这禁用了集成命令help*/
        String[] fullArgs = StringUtils.concatenateStringArrays(args, disabledCommands);
        SpringApplication.run(SpringselltestApplication.class, fullArgs);
    }

    //测试shell:>help
    //No command found for 'help'

}
